/**
 * @param {HTMLElement} el
 * @returns {number}
 */
export function getElementOpacity(el: HTMLElement): number {
  if (!el) return 1
  try {
    const computed = window.getComputedStyle(el, '')
    return parseFloat(computed.opacity) || 1
  } catch (e) {
    return 1
  }
} 